/*
 * Project it.battlehorse.rcp.tools.commons
 * Created on Nov 18, 2005
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 * A copy of the LGPL is available also at
 * http://www.gnu.org/copyleft/lesser.html
 * 
 */ 
package it.battlehorse.rcp.tools.commons.actors;

import java.util.List;

import it.battlehorse.rcp.tools.commons.Severity;

/**
 * A basic implementation for a Validation status. 
 * 
 * @author battlehorse
 * @since Nov 18, 2005
 */
public class BasicValidationStatus implements IValidationStatus {
	
	/**
	 * The validation message
	 */
	private String validationMessage;
	
	/**
	 * A boolean flag which defines if the validation has been successful
	 */
	private boolean isValid;
	
	/**
	 * The list of validation substatuses.
	 */
	private List<IValidationStatus> substatuses;
	
	/**
	 * The  severity of the validation status
	 */
	private Severity severity;
	
	/**
	 * Creates a new instance of the class
	 *
	 */
	public BasicValidationStatus() {
		this(null,false,null,null);
	}
	
	/**
	 * Creates a new configured instance of the class
	 * 
	 * @param validationMessage the validation message
	 * @param isValid the validation status
	 * @param substatuses the validation substatues
	 * @param severity the validation severity
	 */
	public BasicValidationStatus(String validationMessage,
								  boolean isValid,
								  List<IValidationStatus> substatuses,
								  Severity severity) {
		this.validationMessage = validationMessage;
		this.isValid = isValid;
		this.substatuses = substatuses;
		this.severity = severity;
		
	}	
	
	/**
	 * @return Returns the substatuses.
	 */
	public List<IValidationStatus> getSubstatuses() {
		return substatuses;
	}

	/**
	 * @param substatuses The substatuses to set.
	 */
	public void setSubstatuses(List<IValidationStatus> substatuses) {
		this.substatuses = substatuses;
	}

	/**
	 * @param isValid The isValid to set.
	 */
	public void setValid(boolean isValid) {
		this.isValid = isValid;
	}

	/**
	 * @param severity The severity to set.
	 */
	public void setSeverity(Severity severity) {
		this.severity = severity;
	}

	/**
	 * @param validationMessage The validationMessage to set.
	 */
	public void setValidationMessage(String validationMessage) {
		this.validationMessage = validationMessage;
	}

	public String getValidationMessage() {
		return validationMessage;
	}

	public boolean isValid() {
		return isValid;
	}

	public List<IValidationStatus> getSubStatuses() {
		return substatuses;
	}

	public Severity getSeverity() {
		return severity;
	}
	
	

}
